<?php
    include('./library/connsql.php');

    $id = $_REQUEST['goodsid'];

    $sql = "select * from products where id = $id ";

    $res = $mysqli->query($sql);

    $mysqli->close();

    // if($res->num_rows){
    //     echo 1;
    // }

    $row = $res->fetch_assoc();
    // $result = $res->fetch_assoc();

    $json = json_encode($row);
  
    echo $json;

?>